package com.cc.pojo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author c.c
 * @Since 2023/4/20
 * @Time 9:06
 * @Description
 */
@Getter
@AllArgsConstructor
public enum JudgeEnum {

  /**
   * 等于
   **/
  A1("ConditionEnum.eq", "等于"),
  A2("ConditionEnum.like", "具体值 like"),
  A3("ConditionEnum.startwith", "like xxxx%"),
  A4("ConditionEnum.endwith", "like %xxxx"),
  A5("ConditionEnum.containing", "like %xxxx%"),
  A6("ConditionEnum.between", "使用数组，数组应该为两条数据"),
  A7("ConditionEnum.in", "in"),
  A8("ConditionEnum.notin", "notin"),
  A9("ConditionEnum.ge", "equal >="),
  A10("ConditionEnum.gt", "than >"),
  A11("ConditionEnum.le", "equal <="),
  A12("ConditionEnum.lt", "than <"),
  A13("ConditionEnum.isNull", "等于"),
  A14("ConditionEnum.isNotNull", "等于"),
  A15("ConditionEnum.not", "等于"),
  A16("ConditionEnum.other", "等于"),
  A17("ConditionEnum.spellSql", "拼接sql");

  private String value;
  private String des;

  public static JudgeEnum from(String type) {
    for (JudgeEnum judgeEnum : values()) {
      if (type.equals(judgeEnum.name())) {
        return judgeEnum;
      }
    }
    return null;
  }
}
